package com.warom.sdg.dto;

/**
 * 用户数据传输对象
 * 用于添加和更新用户
 */
public class UserDto {
    private Long id;
    private String username;
    private String password;
    private String name;
    private String role;
    private long lastLoginTime;

    // 无参构造函数
    public UserDto() {
    }

    // 带参构造函数
    public UserDto(Long id, String username, String password, String name, String role) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.name = name;
        this.role = role;
        this.lastLoginTime = System.currentTimeMillis();
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public long getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(long lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    @Override
    public String toString() {
        return "UserDto{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='******'" + // 不输出明文密码
                ", name='" + name + '\'' +
                ", role='" + role + '\'' +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }
} 